<script type="text/javascript">
function memProfile(member)
{
	window.location='index.php?viewwhole='+member;
}

function funDelMem(userId) {
	var delPro=confirm("Are you sure want to delete wholeseller?");
    if(delPro==true) {
		var frm = document.getElementById('form1');
		document.getElementById("hidDelMember").value=userId;
	    frm.submit();
	}	
}

function funAppMem(userId) {
	var delPro=confirm("Are you sure want to allow this wholeseller?");
    if(delPro==true) {
		var frm = document.getElementById('form1');
		document.getElementById("hidApprove").value=userId;
	    frm.submit();
	}	
}

function funDisAppMem(userId) {
	var delPro=confirm("Are you sure want to block wholeseller?");
    if(delPro==true) {
		var frm = document.getElementById('form1');
		document.getElementById("hidDisApprove").value=userId;
	    frm.submit();
	}	
}

</script>

<form name="form1" id="form1" method="post" action="">
			  <input type="hidden" name="hidDelMember" id="hidDelMember">
			  <input type="hidden" name="hidApprove" id="hidApprove">
			  <input type="hidden" name="hidDisApprove" id="hidDisApprove">
			  
<table width="100%"  border="1" cellspacing="0" class="container">
  <tr>
    <td width="469" height="25" class="tdHeader">Custom Message List </td>
  </tr>
  <tr>
    <td height="577">
	<br><br>
	<div align="right"><a href="index.php?addcustommessage">Add Custom Message</a></div>
	<table width="100%"  border="0" cellspacing="0">      
      <tr align="right">
        <td colspan="3" align="right"> </td>
        </tr>
      <tr class="InnerHeader">       
        <td width="33%" class="line">Subject</td>
		<td width="38%" class="line">Content </td>
        <td width="29%" class="line">Action</td>         
      </tr>
	  <?php 				 
				 require_once "../includes/pagination.php";
				 $itemPerPage=15;
				 $sql_shocat="SELECT * FROM tbl_customemailmessage";				 
				 $rst_shocat=mysql_query(getPagingQuery($sql_shocat,$itemPerPage));			
				 $numRows = mysql_num_rows($rst_shocat);
				 if($numRows>0) {
					 while($row_shocat = mysql_fetch_array($rst_shocat)) {				 
					 $title=$row_shocat['title'];
					 $content=$row_shocat['content'];
					?>
      <tr class="InnerHeader">
        <td valign="top" class="line"><?php echo $title;?></td>
        <td valign="top" class="line"><?php echo $content;?></td>
        <td valign="top" nowrap="nowrap" class="line"><a href="index.php?sendcustommessage=<?php echo $row_shocat['id'];?>">Send Message</a> | <a href="index.php?editmessage=<?php echo $row_shocat['id'];?>">Edit</a> | <a href="index.php?deletecustommessage=<?php echo $row_shocat['id'];?>">Delete</a></td>
      </tr>     
      <?php } }?>
       </table>
	<div align="center">
		<?php		   
		   $link="wholeseller";
		   echo $disp=getPagingLink($sql_shocat,$itemPerPage,$link);							   
		?>    
	</div>
	</td>
 </tr>
</table>